package com.zxcz.mapper;

import java.util.HashMap;
import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.zxcz.domain.Role;
import com.zxcz.domain.User;

public interface UserMapper {

	User findUserByAccount(String account);

	int modifyPassword(@Param("account")String account,@Param("password")String password);

	User findUserById(Integer id);
	
	List<User> queryUserCondition(@Param("pageNum")int pageNum, @Param("pageSize")int pageSize, 
			@Param("user") User user, @Param("productName") String productName);

	Long getTotal(@Param("user") User user, @Param("productName") String productName);

	List<User> getPageList(@Param("pageNum")int pageNum, @Param("pageSize")int pageSize);

	int updateUser(User user);

	int insertUser(User user);

	int deleteUserById(int id);

	/**
	 * 添加用户角色信息
	 * @param map
	 * @return
	 */
	int saveUserOrRole(HashMap<String, Object> map);

	/**
	 * 删除用户角色
	 * @param id
	 */
	int deleteUserOrRole(int id);

	/**
	 * 获取所有用户列表
	 * @return
	 */
	List<User> queryAllUser();

	List<User> findUserLikeName(String name);

	List<User> findUserLikeAccount(String account);

	
}
